using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class dbinfoMap : EntityTypeConfiguration<dbinfo>
    {
        public dbinfoMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.backup_name)
                .HasMaxLength(100);

            this.Property(t => t.backup_path)
                .HasMaxLength(50);

            this.Property(t => t.dbname)
                .HasMaxLength(50);

            this.Property(t => t.backup_desc)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("dbinfo");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.backup_name).HasColumnName("backup_name");
            this.Property(t => t.backup_path).HasColumnName("backup_path");
            this.Property(t => t.backup_date).HasColumnName("backup_date");
            this.Property(t => t.dbname).HasColumnName("dbname");
            this.Property(t => t.backup_desc).HasColumnName("backup_desc");
        }
    }
}
